﻿using System;
using System.ComponentModel;
using System.Net;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverlightFTP
{
    public class FTPFileOperation : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public int Progress
        {
            get
            {
                double ds = datasent;
                double dl = datalength;
                double p = ds / dl;
                return Convert.ToInt32(p * 100);
            }

        }
        public FileStream fileStream;
        public FileStream FileStream
        {
            get { return fileStream; }
            set { fileStream = value; }
        }
        private string fileName;
        public string FileName
        {
            get { return fileName; }
            set { fileName = value; }
        }
        public string hostdestination;
        public bool allowed;
        public long datalength;
        public long Datalength
        {
            get { return datalength; }
            set { datalength = value; }
        }
        private int datasent;
        public int Datasent
        {
            get { return datasent; }
            set
            {
                datasent = value;
                if (PropertyChanged != null)
                {

                    PropertyChanged(this, new PropertyChangedEventArgs("Progress"));
                }
            }
        }

    }
}
